package com.muse.designpatterns.composite;

import com.google.common.collect.Lists;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * 管理层员工 非叶子节点职员
 */
public class BranchCorp extends AbstractCorp{

    private ArrayList<AbstractCorp> corps = Lists.newArrayList();


    public BranchCorp(String name, String position, int salary) {
        super(name, position, salary);
    }

    public void addSubCorp(AbstractCorp... corp) {
        corps.addAll(Arrays.asList(corp));
    }

    public ArrayList<AbstractCorp> getSubCorp(){
        return corps;
    }
}
